language: php

sudo: true

services:
  - docker

jobs:
  include:
    - &TEST
      php: "5.6"
      before_script:
        - ./travisci/bin/start.sh
        - composer install
        - ./travisci/bin/logs.sh

      script: vendor/bin/phpunit --debug

      after_script:
        - ./travisci/bin/stop.sh
    - <<: *TEST
      php: "7.0"
    - <<: *TEST
      php: "7.1"
    - <<: *TEST
      php: "7.2"
    - <<: *TEST
      php: "7.3"

    - stage: Static analysis with phpstan
      php: "7.3"
      script:
        - composer require --dev phpstan/phpstan
        - vendor/bin/phpstan analyse